<template>
	<u-tabs :list="list" active-color="#000" bg-color="#FFF" :is-scroll="false" :current="current"
		@change="tabChange" :bar-width="80" :bar-style="{
			background:'#2DAAFF'
		}"></u-tabs>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					name: '文章获客',
					url: '/yixu/pages/article_acquisition/index',
				}, {
					name: '发圈文案',
					url: '/yixu/pages/scrunchie_content/index',
				}, {
					name: '业务素材',
					url: '/yixu/pages/friends/lists',
				}, {
					name: '早晚安打卡',
					url: '/yixu/pages/clock_in/clock_in',
				}],
				current: 0,
			}
		},
		props: {
			nowCurrent: {
				type: Number,
				default: 0
			}
		},
		watch: {
			nowCurrent: {
				deep: true,
				immediate: true,
				handler(v) {
					this.current = v;
				}
			}
		},
		methods: {
			tabChange(e) {
				let skipUrl = this.list[e].url || '';
				if (!this.$u.test.isEmpty(skipUrl)) {
					uni.redirectTo({
						url: skipUrl
					})
				}
			}
		}
	}
</script>

<style>
</style>